/*
 * @Description: 准备重写router hidden参数没用将被废除
 * @Autor: wangwangwang
 * @Date: 2021-06-08 13:46:30
 * @LastEditors: wangwangwang
 * @LastEditTime: 2021-08-20 09:36:57
 */

import { getPerMission } from '@/utils/auth.js';
const mixin = {
  data() {
    return {
      ICPStext: '',
      basismenuText: '',
      Topmenu: [{
        name: 'organization',
        title: '基础系统',
        arr: [],
        data: 'basismenu'
      },
      {
        name: 'basicSite',
        title: 'ICPS系统',
        arr: [],
        data: 'ICPS'
      }
      ],
      ICPS: [{
        title: '基础配置',
        index: 'basicConfig',
        name: '基础配置',
        arr: [
          // {
          //   title: '欢迎使用ICPS',
          //   index: 'ICPSIndex',
          //   hidden: true
          // },
          {
            title: '车辆维护',
            index: 'basiccar',
          },
          {
            title: '泵车维护',
            index: 'basicEquipmente',
          },
          {
            title: '车载设备维护',
            index: 'carEquipmentManagement',
          },
          {
            title: '通知维护',
            index: 'basicnotice',
          },
          {
            title: '工艺流程',
            index: 'basicproflow',
          },
          {
            title: '条码维护',
            index: 'basicbarcode',
          },
          {
            title: '基础调价维护',
            index: 'basicAbnormal',
          },
          {
            title: '积分维护',
            index: 'smart_integral',
            arr: [
              {
                title: '用户积分',
                index: 'smart_integral_user',
              }, {
                title: '积分设置',
                index: 'smart_integral_set',
              },]
          },
        ]
      },
      {
        title: '绿舍云销',
        index: 'internetSales',
        name: '绿舍云销',
        arr: [{
          title: '评估因子维护',
          index: 'basicfactor',
        },
        {
          title: '标号信息价维护',
          index: 'basicpriceMaintenance',
        },{
          title: '客户管理',
          index: 'customerManagement',
        },
        {
          title: '生产处客户管理',
          index: 'customerManagementProduction',
        },
        {
          title: '机会管理',
          index: 'internetSalessalesoppo',
        },
        {
          title: '销售机会',
          index: 'chanceManagement',
        },
        { 
          title: '工程维护',
          index: 'engineeringMaintenance',
          name: '',
          arr: [{
            title: '工程登记',
            index: 'projectManagement',
          },
          {
            title: '工程评估',
            index: 'projectAssess',
          },
          {
            title: '工程评估审核',
            index: 'EngineeringEvaluation',
            hidden: true,
          },
          {
            title: '工程投标',
            index: 'internetSalestender',
          },
          {
            title: '工程交底',
            index: 'projectClarifi',
          },
          {
            title: '工程交底审核',
            index: 'ProjectClarifiFlow',
            hidden: true,
          },{
            title: '工程调价',
            index: 'engineeringControl',
          },
          {
            title: '工程票据',
            index: 'engineeringNotes',
          },{
            title: '工程评估登记',
            index: 'assess',
            hidden: true
          },
          {
            title: '风险管控审批',
            index: 'RiskControlFlow',
            hidden: true
          },]
        },
        {
          title: '工程履约',
          index: 'performanceRecord',
        },],
      },
      {
        title: '绿舍数采',
        index: 'GHnumber',
        name: '绿舍数采',
        arr: [{
          title: '原物料管理',
          index: 'basicRmaterial',
        },{
          title: '供应商维护',
          index: 'GHnumberSupplier',
        },
        {
          title: '合同维护',
          index: 'GHnumberContract',
          name: '',
          arr: [{
            title: '原物料',
            index: 'GHnumberContractcontract',
          }, {
            title: '车辆外包',
            index: 'GHnumberContractcar',
          },
          {
            title: '设备外包',
            index: 'GHnumberContractequipment',
          },
          {
            title: '泵管外包',
            index: 'GHnumberContractpumpTube',
          },
          {
            title: '往来协作',
            index: 'GHnumberContractoutsourcing',
          },
          ],
        },
        {
          title: '份额维护',
          index: 'GHnumberShare',
        },
        {
          title: '站点配比维护',
          index: 'GHnumberSPratio',
        },
        {
          title: '站点采购配合比审批',
          index: 'SiteProportion',
          hidden: true
        },
        {
          title: '额外采购下单',
          index: 'GHnumberDSPplorder',
        },
        {
          title: '额外采购下单审批',
          index: 'PurchaseOrder',
          hidden: true
        },
        {
          title: '供应清单',
          index: 'GHnumberDemand',
        },
        {
          title: '车辆转派审批',
          index: 'CarTransfer',
          hidden: true,
        },
        {
          title: '收货查询',
          index: 'GHnumberGoods',
        },
        {
          title: '退货审批',
          index: 'cancleOrder',
          hidden: true,
        },
        {
          title: '采购审批',
          index: 'GHnumberDSP',
        },
        {
          title: '供应商评价查询',
          index: 'GHnumberevaquery',
        },
        {
          title: '原物料调拨',
          index: 'GHnumbertransfers',
        },
        {
          title: '供应商系统',
          index: 'supplier',
          name: '',
          arr: [{
            title: '混凝土订单',
            index: 'concreteOrder',
          }, {
            title: '车辆维护',
            index: 'supplierCar',
          },
          {
            title: '泵车维护',
            index: 'supplierEquipment',
          },
          {
            title: '供应清单',
            index: 'supplierPlan',
          },
          {
            title: '供应评价查询',
            index: 'supplierEvaluation',
          },
          {
            title: '交货查询',
            index: 'supplierQuery',
          },
          {
            title: '结算确认',
            index: 'settlement',
          }
          ],
        },
        {
          title: '合作等级变更',
          index: 'ChangeLevelCoop',
          hidden: true
        },
        {
          title: '供应商评价审核',
          index: 'SupplierRating',
          hidden: true
        },
        {
          title: '份额维护审核',
          index: 'ShareMaintenance',
          hidden: true
        },
        {
          title: '追加计划',
          index: 'AddOrder',
          hidden: true
        },
        ],
      },
      {
        title: '绿舍智造',
        index: 'smart',
        name: '绿舍智造',
        arr: [{
          title: '站点维护',
          index: 'basicSite',
        },{
          title: '电子围栏',
          index: 'smartschedula',
        },{
          title: '混凝土产品命名规则',
          index: 'basicCCTrules',
        },{
          title: '公司标准产品配合比',
          index: 'companyStandard',
        },{
          title: '站点配合比',
          index: 'basicmix',
        },{
          title: '站点配合比审批',
          hidden: true,
          index: 'sign_mix',
        },{
          title: '计量设备维护',
          index: 'basicotherEquipmente',
        },{
          title: '回弹仪维护',
          index: 'basicspringback',
        },
        {
          title: '其他设备维护',
          index: 'basicotherSE',
        },{
          title: '预算管理',
          index: 'schedul',
          arr: [
          {
            title: '图算维护',
            index: 'smartschedulb',
          },
          {
            title: '计划审核',
            index: 'smartschedulc',
          }]
        },{
          title: '订单管理',
          index: 'orderManagement',
          arr: [{
            title: '生产排程',
            index: 'smartscheduld',
          },
          {
            title: '生产调整审批',
            hidden: true,
            index: 'sign_smartscheduld',
          },
          {
            title: '生产调度',
            index: 'smartschedulj',
          },
          {
            title: '生产调度异常处理审批',
            hidden: true,
            index: 'sign_smartschedulj',
          },
          {
            title: '产量统计',
            index: 'smartschedule',
          },
          {
            title: '物流跟踪表',
            index: 'WLGZB',
          }
          ]
        },{
          title: '罐车管理',
          index: 'carManagement',
          arr: [{
            title: '罐车调度',
            index: 'carDispatch',
          },{
            title: '运输地图',
            index: 'smartschedulk',
          }]
        },{
          title: '材料管理',
          index: 'materialManagement',
          arr: [{
            title: '采购申请',
            index: 'smartschedulh',
          },{
            title: '库存维护',
            index: 'smartstocksake',
          },
          {
            title: '库存盘点审批',
            hidden: true,
            index: 'sign_stocksake1',
          },
          {
            title: '库存调拨审批',
            hidden: true,
            index: 'sign_stocksake2',
          },
          {
            title: '液位仪',
            index: 'smart_warehouseLIM',
          }]
        },{
          title: '质量管理',
          index: 'qualityManagement',
          arr: [{
            title: '质量参数',
            index: 'qualityParams',
            arr: [{
              title: '公司质量参数',
              index: 'basicCPYquality',
            },
            {
              title: '公司质量参数审批',
              hidden: true,
              index: 'sign_CPYquality',
            },
            {
              title: '站点质量参数',
              index: 'basicSitequality',
            },
            {
              title: '站点质量参数审批',
              hidden: true,
              index: 'sign_Sitequality',
            },]
          },{
            title: '原物料品质检验',
            index: 'materialcheckout',
            arr: [{
              title: '快速检验',
              index: 'fastcheckout',
            },
            {
              title: '批次检验',
              index: 'batchcheckout',
            },
            {
              title: '原物料复检',
              index: 'recheckout',
            },
            {
              title: '原物料抽检',
              index: 'spotcheckout',
            },
            {
              title: '原物料其他检验',
              index: 'othercheckout',
            },
            {
                title: '原物料送检',
                index: 'inscheckout',
            },
            {
                title: '见证取样检验',
                index: 'specheckout',
            },
            {
                title: '水泥胶砂基准强度',
                index: 'cementMortar',
            },
            {
              title: '原物料检测审批',
              index: 'checkflows',
              hidden: true,
            },
            {
              title: '回弹检测',
              index: 'SpringbackCheck',
              hidden: true,
            },
            {
              title: '泵工异常申报',
              index: 'ExceptionsApply1',
              hidden: true,
            },
            {
              title: '前场工长异常申报',
              index: 'ExceptionsApply2',
              hidden: true,
            },
            {
              title: '罐车司机异常申报',
              index: 'ExceptionsApply3',
              hidden: true,
            },
            ],
          },{
            title: '混凝土品质检验',
            index: 'soiltest',
            arr: [{
              title: '出场检验',
              index: 'entercheckout',
            },
            {
              title: '混凝土其他检验',
              index: 'concretecheckout',
            },
            {
              title: '回弹检验',
              index: 'smartsoiltesta',
            },
            {
              title: '回弹记录',
              index: 'smartsoiltesta_a',
              hidden: true,
            },
            {
              title: '回弹养护作业',
              index: 'smartsoiltestb',
            },
            {
              title: '三方检测报告',
              index: 'smartsoiltestc',
            },
            {
              title: '混凝土检测审批',
              index: 'checkflows2',
              hidden: true,
            },
            {
              title: '原物料三方检测审批',
              index: 'ThirdCheck1',
              hidden: true,
            },
            {
              title: '混凝土三方检测审批',
              index: 'ThirdCheck2',
              hidden: true,
            },
            ],
          },{
            title: '浆水检验',
            index: 'smartwatertest',
          },{
            title: '环境监测',
            index: 'environmentalMonitor',
          },]
        },{
          title: '交工资料',
          index: 'handoverInformation',
          arr: [{
            title: '配合比库',
            index: 'smarmix',
          },
          {
            title: '交工数据维护',
            index: 'smartdata',
          }]
        },
        {
          title: '特材库维护',
          index: 'smart_specialmaterial',
          arr: [
            {
              title: '基础信息维护',
              index: 'baseMessage',
              arr: [{
                title: '车辆维护',
                index: 'smart_specialmaterial_car',
              },{
                title: '特材原料维护',
                index: 'smart_specialmaterial_material',
              },{
                title: '特材质量参数',
                index: 'smart_specialmaterial_quality',
              },{
                title: '特材供应商维护',
                index: 'smart_specialmaterial_supplier',
              }],
            },
            {
              title: '供应商来料',
              index: 'smart_specialmaterial_income',
            },
            {
              title: '特材原料检验',
              index: 'smart_specialmaterial_test',
            },
            {
              title: '特材原料复检',
              index: 'smart_specialmaterial_retest',
            },
            {
              title: '计划管理',
              index: 'panManagement',
              arr: [{
                title: '需求计划',
                index: 'smart_specialmaterial_Deplan',
              },
              {
                title: '生产计划',
                index: 'smart_specialmaterial_prodplan',
              }]
            },
            {
              title: '特材成品维护',
              index: 'smart_specialmaterial_product',
            },
            {
              title: '特材成品入库检验',
              index: 'smart_specialmaterial_incometest',
            },
            {
              title: '特材成品复验',
              index: 'smart_specialmaterial_incomeretest',
            },
            {
              title: '特材交易统计',
              index: 'SpecialMaterialStatistics',
            },
            {
              title: '特材运输清单',
              index: 'smart_specialmaterial_shiplist',
            },
            {
              title: '特材检验审批',
              index: 'SpecialCheckFlows',
              hidden: true,
            },
            {
              title: '外加剂返料',
              index: 'smart_warehouseADRN',
            }, {
              title: '外加剂返料审批',
              hidden: true,
              index: 'sign_ADRN',
            }
          ]
        },
        {
          title: '异常处理',
          index: 'smartschedulg',
        },
        // {
        //   title: '仓库管理',
        //   index: 'smart_warehouse',
        //   arr: [
        //   ]
        // },
        // {
        //   title: '外协系统',
        //   index: 'out',
        //   arr: [
        //     {
        //       title: '需求中心',
        //       index: 'smartouta',
        //     },
        //     {
        //       title: '订单管理',
        //       index: 'smartoutb',
        //     }
        //   ],
        // }
        ],
      },
      {
        title: '绿舍优服',
        index: 'besSer',
        name: '绿舍优服',
        arr: [{
            title: '泵机维护',
            index: 'pumpMmanagement',
            arr: [{
              title: '泵送作业',
              index: 'smartschedulf',
            },{
              title: '泵机调度',
              index: 'smartscheduli',
            },]
          },
          {
            title: '前场日志',
            index: 'smartschedul_frontLog',
          },
          {
            title: '周材维护',
            index: 'WMmanagement',
            arr: [
              {
                title: '周材采购',
                index: 'besSer_WMharvest',
              },
              {
                title: '周材入库',
                index: 'besSer_WMinstorage',
              },
              {
                title: '周材库存',
                index: 'besSer_WMinventory',
              },
              {
                title: '周材出库',
                index: 'besSer_WMoutbound',
              },
              {
                title: '周材回收',
                index: 'besSer_WMrecycling',
              },
              {
                title: '周材报废',
                index: 'besSer_WMscrap',
              },
              {
                title: '周材报废审批',
                index: 'materialScrap',
                hidden: true,
              },
              {
                title: '泵送难度模型',
                index: 'besSer_WMPMDM',
              }
            ],
          },
          {
            title: '客户评价',
            index: 'besSera',
          },
        ],
      },
      {
        title: '绿舍慧算',
        index: 'Wise',
        name: '绿舍慧算',
        arr: [{
          title: '原物料结算',
          index: 'Wise_material',
        },
        {
          title: '原物料结算审批',
          hidden: true,
          index: 'sign_material',
        },
        {
          title: '混凝土结算',
          index: 'Wise_concrete',
        },
        {
          title: '混凝土结算审批',
          hidden: true,
          index: 'sign_concrete',
        },
        {
          title: '外租单位结算',
          index: 'Wise_rentunit',
          arr: [
            {
              title: '原物料运输结算',
              index: 'Wise_rentunit1',
            },
            {
              title: '原物料运输结算审批',
              hidden: true,
              index: 'sign_Wise_rentunit1',
            },
            {
              title: '混凝土运输结算',
              index: 'Wise_rentunit2',
            },
            {
              title: '混凝土运输结算审批',
              hidden: true,
              index: 'sign_Wise_rentunit2',
            },
            {
              title: '泵送作业结算',
              index: 'Wise_rentunit3',
            },
            {
              title: '泵送作业结算审批',
              hidden: true,
              index: 'sign_Wise_rentunit3',
            },
          ],
        },
        {
          title: '往来业务结算',
          index: 'Wise_contactsbusiness',
          arr: [
            {
              title: '外协业务结算',
              index: 'Wise_contactsbusiness1',
            },
            {
              title: '外协业务结算审批',
              hidden: true,
              index: 'sign_Wise_contactsbusiness1',
            },
            {
              title: '协外业务结算',
              index: 'Wise_contactsbusiness2',
            },
            {
              title: '协外业务结算审批',
              hidden: true,
              index: 'sign_Wise_contactsbusiness2',
            },
          ],
        },
        {
          title: '内部单位结算',
          index: 'Wise_internalunit',
        },
        ],

      },
        // {
        //   title: '销售看板',
        //   index: 'board',
        //   name: '',
        //   arr: [
        //     {
        //       title: '看板数据源',
        //       index: 'board_datasource',
        //     },
        //     // {
        //     //   title: '销售看板',
        //     //   index: 'board_Salesofkanban',
        //     // }
        //   ]
        // },

      ],
      basismenu: [{
        title: '基础数据维护',
        index: 'basicData',
        name: 'aside_icon_data',
        arr: [
          {
            title: '欢迎使用基础系统',
            index: 'basicIndex',
            hidden: true
          },
          {
            title: '组织管理',
            index: 'organization',
          },
          {
            title: '岗位管理',
            index: 'jobs'
          },
          {
            title: '用户管理',
            index: 'user'
          },
          {
            title: '业务系统管理',
            index: 'business'
          },
          {
            title: '功能管理',
            index: 'function'
          },
          {
            title: '个人用户创建',
            index: 'IndividualUser'
          },
          {
            title: '个人权限授权',
            index: 'PersonalRights'
          },
          {
            title: '权限管理',
            index: 'permissions'
          },
          {
            title: '权限申请',
            index: 'PermissionsApply'
          },
          {
            title: '兼职管理',
            index: 'partTime'
          },
          {
            title: '角色管理',
            index: 'role'
          },
          {
            title: '数据权限配置',
            index: 'DataAccess'
          },
          {
            title: '字典管理',
            index: 'dictionary'
          },
          {
            title: '通知通告',
            index: 'notice'
          },
          {
            title: '编辑通知通告',
            index: 'noticeEdit',
            hidden: true
          },
          {
            title: '首页配置',
            index: 'pageConfig'
          },
          {
            title: '调度维护',
            index: 'scheduling'
          },
          {
            title: 'APP管理',
            index: 'APPmanagement'
          },
          {
            title: '移动端banner',
            index: 'mobileBanner'
          },
          {
            title: '关于华西',
            index: 'aboutUs'
          },
          {
            title: '附件管理',
            index: 'attachment'
          },
          {
            title: '单据编码规则',
            index: 'CodingRules'
          },
          {
            title: '系统参数',
            index: 'SystemParameters'
          },
          {
            title: '关键日志记录',
            index: 'KeytoLog'
          },
          {
            title: '日常日志记录',
            index: 'DailyLog'
          },
          {
            title: '接口访问时长',
            index: 'InterfaceTime'
          },
          {
            title: '消息日志',
            index: 'MessageLog'
          }
        ]
      },
      {
        title: '签核系统',
        index: 'Signed',
        name: 'aside_icon_signed',
        arr: [{
          title: '审批要素',
          index: 'DieEemente'
        },
        {
          title: '审批人类型',
          index: 'TypeApprover'
        },
        {
          title: '流程代理',
          index: 'processAgent'
        },
        {
          title: '流程配置',
          index: 'processConfig',
          hidden: true
        },
        {
          title: '流程管理',
          index: 'ProcessManagement'
        },
        {
          title: '流程任务维护',
          index: 'ProcessTaskMaintenance'
        }
        ]
      },
      {
        title: '任务中心',
        index: 'task',
        name: 'aside_icon_taskc',
        arr: [{
          title: '新建任务',
          index: 'NewTask'
        },
        {
          title: '任务中心',
          index: 'taskCenter',
          hidden: true,
        },
        {
          title: '任务详情',
          index: 'taskDetails',
          hidden: true,
        },
        {
          title: '待办任务',
          index: 'taskagents'
        },
        {
          title: '待发任务',
          index: 'undertakesTask'
        },
        {
          title: '本人发起',
          index: 'iama'
        },
        {
          title: '提交任务',
          index: 'submiTask'
        },
        {
          title: '已办任务',
          index: 'doTasks'
        },
        {
          title: '收藏任务',
          index: 'colTask'
        },
        {
          title: '跟踪事项',
          index: 'Trackitems'
        }
        ]
      },
      {
        title: '接口',
        index: 'interface',
        name: 'aside_icon_port',
        arr: [{
          title: '第三方应用维护',
          index: 'ThirdpartyApp'
        },
        {
          title: '对外API注册',
          index: 'APIReg'
        }
        ]
      },
      {
        title: '同步管理',
        index: 'sync',
        name: '同步管理',
        arr: [{
          title: '数据源管理',
          index: 'syncDatasource'
        },
        {
          title: '同步任务管理',
          index: 'syncTask'
        }
        ]
      },
      ],
    }
  },
  created() {
    /**判断系统 */
    this.Topmenu = this.fiterTopmenu(this.Topmenu)
    if (this.Topmenu.some(res => (res.data == 'basismenu'))) {
      this.basismenu = this.fiterbasismenu(this.basismenu)
    }
    /**ICPS系统 */
    if (this.Topmenu.findIndex(res => (res.data == 'ICPS')) !== -1) {
      this.fiterICPS(this.ICPS)
      /**第一層刪除*/
      this.ICPS = this.ICPS.filter(res => (res.arr.length !== 0))
      /**第二層刪除*/
      for (let a in this.ICPS) {
        for (let b = 0; b < this.ICPS[a].arr.length; b++) {
          if (this.ICPS[a].arr[b].arr) {
            if (this.ICPS[a].arr[b].arr.length == 0) {
              this.ICPS[a].arr.splice(b, 1)
              b--
            } else if (this.ICPS[a].arr[b].arr.length>0) {
              for (let i =0; i < this.ICPS[a].arr[b].arr.length; i+=1) {
                if (this.ICPS[a].arr[b].arr[i].arr && this.ICPS[a].arr[b].arr[i].arr.length === 0) {
                  this.ICPS[a].arr[b].arr.splice(i, 1);
                  i--
                } else if (this.ICPS[a].arr[b].arr[i].arr && this.ICPS[a].arr[b].arr[i]?.arr?.length> 0) {
                  for (let j = 0; j < this.ICPS[a].arr[b].arr[i].arr.length; j+=1) {
                    if (this.ICPS[a].arr[b].arr[i].arr[j].arr && this.ICPS[a].arr[b].arr[i].arr[j].arr.length === 0) {
                      this.ICPS[a].arr[b].arr[i].arr.splice(j, 1)
                      j--
                    }
                  }
                }
              }
            }
          }
        }
      }
      for (let a in this.ICPS) {
        for (let b = 0; b < this.ICPS[a].arr.length; b++) {
          if (this.ICPS[a].arr[b].arr) {
            if (this.ICPS[a].arr[b].arr.length == 0) {
              this.ICPS[a].arr.splice(b, 1)
              b--
            }
          }
        }
      }
      this.ICPS = this.ICPS.filter(res => (res.arr.length !== 0))
      this.ICPS = JSON.parse(JSON.stringify(this.ICPS))
      /**添加销售看板*/
      let arr = getPerMission()?.functionLimitList.filter(res => (res.code.indexOf('board_Salesofkanban') !== -1));
      let kanbanarr = []
      let arr1 = getPerMission()?.functionLimitList.filter(res => (res.code.indexOf('board_datasource') !== -1))
      let kanbanarr2 = []
      let arr2 = getPerMission()?.functionLimitList.filter(res => (res.code.indexOf('editBoard') !== -1))
      let kanbanarr1 = []
      if (arr1.length !== 0) {
        kanbanarr1 = arr1.map(res => {
          let obj = {
            title: res.name,
            index: 'board_datasource'
          }
          return obj
        })
      }
      if (arr2.length !== 0) {
        kanbanarr2 = arr2.map(res => {
          let obj = {
            title: res.name,
            index: 'editBoard',
            hidden: true
          }
          return obj
        })
      }
      if (arr.length !== 0) {
        kanbanarr = arr.map(res => {
          let obj = {
            title: res.name,
            index: res.code,
            functionId: res.functionId
          }
          return obj
        })
      }
      if ([...kanbanarr1, ...kanbanarr2, ...kanbanarr].length !== 0) {
        let kanban = {
          title: '综合看板',
          index: 'board',
          name: '综合看板',
          arr: [...kanbanarr1, ...kanbanarr2, ...kanbanarr]
        }
        this.ICPS.push(kanban)
      }
    }
    /**
     * @Description: 补丁-往ICPS里面增加内部链接
     * @param {*}
     * @Author: wangwangwang
     */    
    let insideUrl = getPerMission()?.functionLimitList.filter(item => (item.folderType === 3));
    this.formatUrl(this.ICPS, insideUrl);
    /**侧边导航生成*/
    this.Topmenu = this.Topmenu.map(item => {
      item.arr = this[item.data];
      return item;
    });
    /**
     * @Description: 构造系统外部链接导航
     * @param {*}
     * @Author: wangwangwang
     */
    if (getPerMission()?.systemList.length) {
      const outUrl = getPerMission()?.systemList.filter(item => item?.systemName !== '基础系统' && item?.systemName !== 'ICPS系统');
      const newOutUrl = outUrl.map(item => {
        const arr = getPerMission()?.functionLimitList.filter(items => items?.systemId === item?.systemId).map(items => ({title: items.name, redirectUrl: items.redirectUrl, name: items.code, index: items.code, type: 2}));
        return {
          title: item?.systemName,
          name: item?.systemId,
          data: item?.systemId,
          type: 2,
          arr,
        }
      })
      if (newOutUrl.length > 3) {
        const newArry1 = newOutUrl.filter((_, index) => index < 2);
        const newArry2 = newOutUrl.filter((_, index) => index > 1);
        const data = {
          data: "more",
          name: "more",
          title: "更多",
          type: 2,
          children: newArry2,
        }
        newArry1.push(data);
        this.Topmenu = this.Topmenu.concat(newArry1);
        return
      }
      this.Topmenu = this.Topmenu.concat(newOutUrl);
    }
  },
  methods: {
    formatUrl (icpsArry, insideUrl) {
      for (let i = 0; i < icpsArry.length; i+=1) {
        for (let j = 0; j < insideUrl.length; j+=1) {
          if (icpsArry[i].title === insideUrl[j].parentName) {
            const data = {
              title: insideUrl[j].name,
              index: insideUrl[j].code,
              url: insideUrl[j].redirectUrl,
            }
            icpsArry[i].arr.push(data);
          }
        }
        if (icpsArry[i].arr) {
          this.formatUrl(icpsArry[i].arr, insideUrl);
        }
      }
    },
    // formatIcps(nodes, predicate) {
    //   if (!(nodes && nodes.length)) {
    //     return [];
    //   }
    //   const newChildren = [];
    //   for (const node of nodes) {
    //     if (predicate(node) || (node.arr && !node.hidden)) {
    //       newChildren.push(node);
    //       node.arr = this.formatIcps(node.arr, predicate);
    //     } else {
    //       newChildren.push(...this.formatIcps(node.arr, predicate));
    //     }
    //   }
    //   console.log(newChildren)
    //   return newChildren;
    // },
    fiterICPS(newarr) {
      let _this = this
      newarr.forEach(res => {
        if (res.arr) {
          res.arr = res.arr.filter(item => getPerMission()?.functionLimitList.some(items => (items.code == item.index || item.arr && !item.hidden))) // code相等或者hidden为true的菜单才能显示
          if (res.arr.length !== 0) {
            _this.fiterICPS(res.arr)
          }
        }
      })
    },
    /**生成顶部菜单*/
    fiterTopmenu(arr) {
      let arr1 = arr.filter(res => (
        getPerMission()?.systemList.some(item => (res.title == item?.systemName))
      ))
      return arr1
    },
    /**生成基础系统菜单*/
    fiterbasismenu(arr) {
      arr.forEach(res => {
        res.arr = res.arr.filter(item => getPerMission()?.functionLimitList.some(items => (items.code == item.index && !item.hidden)))
      })
      let arr1 = arr.filter(res => (res.arr.length !== 0))
      return arr1
    },
  },
}
export default mixin